<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <!-- 默认情况下不管你输入，拿到的都是字符串 -->
        <input type="text" v-model.number="num1">
        <span>+</span>
        <input type="text" v-model.number="num2">
        <span>={{ result }}</span>

        <input type="text" v-model.trim.lazy="msg">

        <div>
            <input type="text" v-model.lazy="msg2">
            <p>{{ msg2 }}</p>
        </div>
    </div>

    <script src="./vue.js"></script>
    <script>
        new Vue({
            el: '#app',
            data: {
                num1: 0,
                num2: 0,
                msg: '',
                msg2: ''
            },
            // 写计算属性的地方
            computed: {

                // 计算属性名
                result () {
                    console.log('result调用了')
                    return this.num1 + this.num2
                }
            }
        })
    </script>
</body>
</html>